<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
    />
    <title>给图片添加水印</title>
    <style>
        .shiyin {
            background: rgba(0, 0, 0, 1) url('./shuiyin.jpg') repeat 0 0;
        }
        .shiyin img{
            opacity: 0.8;
        }
    </style>
</head>

<body>
    <div class="shiyin">
        <img src="./img.jpg" alt="tupian">
    </div>

</body>
</html>